export ARCH=arm64#设置平台架构
export CROSS_COMPILE=aarch64-linux-gnu-#交叉编译器前缀


KERN_VER = $(shell uname -r)
# 在开发板上测试
KERN_DIR = /home/robin/work/kernel-rockchip-nanopi4-linux-v4.4.y

obj-m := mutex.o


APP = app
TARGET = app.out

PWD ?= $(shell pwd)
all:
	make -C $(KERN_DIR) M=$(PWD) modules    #make操作
#	aarch64-linux-gnu-gcc app.c -o $(APP)
	aarch64-linux-gnu-gcc $(APP).c -o $(TARGET)

install:
	scp *.ko $(TARGET) root@192.168.107.61:/drv_code

clean:
	make -C $(KERN_DIR) M=$(PWD) clean    #make clean操作
